.PHONY: all clean

all: main

# Build Rust library
rust_lib/target/release/librust_lib.so:
	cd rust_lib && cargo build --release

# Build C program and link with Rust library
main: main.c rust_lib/target/release/librust_lib.so
	gcc -o main main.c -L./rust_lib/target/release -lrust_lib -Wl,-rpath,./rust_lib/target/release

clean:
	rm -f main
	cd rust_lib && cargo clean
